package com.cx.base.day13_io.io_05_objectStream;

import com.cx.base.day16_映射.Student;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;

/**
 * @Author: robert.song
 * @Date: Created in 2022/4/23
 */
@Data
public class Person implements Serializable {

    private static final long serialVersionUID = -6849794470754667710L;

    private String name;
    private int age;
    //  如果变量是引用类型，要实现序列化也要实现Serializable接口
//  如果要忽略对此变量序列化，需要添加transient关键词
    private Student s1 = new Student();
    private transient Student s2 = new Student();

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
